package cn.bonoon.kernel.web.controllers;

public abstract class AbstractGridResolver extends StatusButtonResolver{
	private String gridId;
	private boolean passByParameter;
	
	public AbstractGridResolver(String gridId){
		this.gridId = gridId;
	}
	
	public void passByParameter(){
		passByParameter = true;
	}
	
	public boolean isPassByParameter() {
		return passByParameter;
	}
	
	@Override
	protected StringBuilder parseUrl(String url) {
		StringBuilder su = super.parseUrl(url);
		
		if(passByParameter){
			if(su.indexOf("?") > 0){
				su.append('&');
			}else{
				su.append('?');
			}
			su.append("gridid=").append(gridId);
		}
		
		return su;
	}
}
